package kr.pe.asuraho;

import java.io.IOException;
import java.util.Date;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.simple.JSONObject;

public class Servlet002 extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setAttribute("msg", "(/^0^)/(_-.-)_ O BBa~~ Dal Ryo~~");
		req.setAttribute("msg2", "-_-;;");

		test001();
		
		test002();
		System.out.println(new Date());
		System.out.println(new Date());
		System.out.println(new Date());
		System.out.println(new Date());
		JSONObject obj = new JSONObject();
		obj.put("name", "foo33333333333333333333333333333333333333333333");
		obj.put("num", new Integer(100));
		obj.put("balance", new Double(1000.21));
		obj.put("is_vip", new Boolean(true));
		obj.put("nickname", null);
		
		req.setAttribute("msg3", obj.toString());

		RequestDispatcher view = req.getRequestDispatcher("/index.jsp");
		view.forward(req, resp);
	}

	private void test001() {
		String aaa = null;
//		if (aaa.equals("cnwlgh")) {
//			System.out.println(1233);
//		}
	}
	
	private String test002(){
		return null;
	}
}